#!/bin/bash

set -e

# Back up notebooks
TMP_CONTENT_DIR=/tmp/scikit-survival
mkdir -p $TMP_CONTENT_DIR
cp -r doc/user_guide .binder $TMP_CONTENT_DIR
# delete everything in current directory including dot files and dot folders
find . -delete

# Copy notebooks and remove other files from user_guide folder
NOTEBOOKS_DIR=notebooks
cp -r $TMP_CONTENT_DIR/user_guide $NOTEBOOKS_DIR
find $NOTEBOOKS_DIR -not -name '*.ipynb' -type f -delete

# Put the .binder folder back (may be useful for debugging purposes)
mv $TMP_CONTENT_DIR/.binder .
# Final clean up
rm -rf $TMP_CONTENT_DIR
